package com.itheima;

import com.itheima.dao.BookDao;
import com.itheima.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Xiao
 * @date 2021/9/12
 */
public class App03 {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("aplicationContext.xml");
        BookDao bookDao = ctx.getBean("bookDao", BookDao.class);
        /*如果注解没有指定id，要使用指定类型获取Bean对象*/
        BookService bookService = ctx.getBean(BookService.class);
        bookDao.save();
        bookService.serve();
    }
}
